
		Imports Acceso_a_Datos.Datos
		Namespace BO
		Partial Public Class tVisitas



# Region "tEtapas"

		private mtEtapas As New tEtapas

		Public Property tEtapas As tEtapas
        Get
                mtEtapas = mtEtapas.TraerFiltradoListOf("IdEtapas", Me.IdEtapas).Item(0)
        Return mtEtapas
        End Get
        Set
             If ((mtEtapas Is Nothing) Or (Me.tEtapas.Equals(value) = False)) Then
                If Not (Me.tEtapas Is Nothing)
	               Dim oldtEtapas As tEtapas = Me.tEtapas
                   Me.mtEtapas = Nothing
                   oldtEtapas.RemoveListatVisitas(Me)
             	End If
            	If Not (value Is Nothing) Then
                   Me.mtEtapas = value
                   Me.tEtapas.AddListatVisitas(Me)
            	End If
             End If
        End Set
       End Property

# End Region


# Region "Lecturas que devuelven listas"
Public Function TraerTodosListOf() As List(Of tVisitas)
            Dim dtDatos As DataTable
            Dim listatVisitas As New List(Of tVisitas)
            Dim param As [String]
            param = (Me.mNombreEntidad + "_SelectAll")
            dtDatos = Me.ServidorDatos.TraerDataTable(param)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtVisitas As New tVisitas
				mtVisitas.IdVisita = CType(dr.Item("IdVisita"),Integer)
				mtVisitas.Traer_objeto()
            	listatVisitas.Add( mtVisitas)
    		Next dr
Return listatVisitas
End Function

Public Function TraerFiltradoListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tVisitas)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatVisitas As New List(Of tVisitas)
            param = (Me.mNombreEntidad + "_Tx")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtVisitas As New tVisitas
				mtVisitas.IdVisita = CType(dr.Item("IdVisita"),Integer)
				mtVisitas.Traer_objeto()
            	listatVisitas.Add( mtVisitas)
    		Next dr
Return listatVisitas
End Function

Public Function TraerFiltradoLikeListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tVisitas)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatVisitas As New List(Of tVisitas)
            param = (Me.mNombreEntidad + "_TxLike")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtVisitas As New tVisitas
				mtVisitas.IdVisita = CType(dr.Item("IdVisita"),Integer)
				mtVisitas.Traer_objeto()
            	listatVisitas.Add( mtVisitas)
    		Next dr
Return listatVisitas
End Function
# End Region

End Class
End Namespace
